package io.kiki.sba.registry.server.clientInterface.store;

import io.kiki.sba.registry.common.model.store.Subscriber;
import io.kiki.sba.registry.server.clientInterface.registry.ClientInterfaceRegistry.SelectSubscriber;

import java.util.List;
import java.util.Map;
import java.util.Set;


public interface Subscribers extends DataManager<Subscriber, String, String> {

    /**
     * check subscribers interest dataInfoId version,very dataCenter dataInfoId version different if
     * return false else check return bigger version
     */
    SubscriberVersionCheck checkInterestVersion(String dataCenter, String datumDataInfoId, long version);

    List<Subscriber> getSubscriberList(String datumDataInfoId);

    SelectSubscriber selectSubscribers(Set<String> dataCenters);

    Map<String, List<String>> filterIPs(String group, int limit);

    enum SubscriberVersionCheck {
        NoSub(false), Obsolete(false), Interested(true),
        ;
        public final boolean interested;

        SubscriberVersionCheck(boolean Interested) {
            this.interested = Interested;
        }
    }
}
